package com.permission.param;

import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * Created by Administrator on 2018/4/16
 */
@Data
public class AddAclParam {

    @NotNull(message = "父ID不存在")
    private Integer aclParentId;

    @NotNull(message = "权限名称不能为空")
    @Length(max = 32, message = "权限名称长度不能超过32个字符")
    private String aclName;

    @Length(max = 32, message = "权限URL长度不能超过32个字符")
    private String aclUrl;

    @Pattern(regexp = "GET|DELETE|POST|PUT|get|delete|post|put",
            message = "权限的方法：GET|DELETE|POST|PUT|get|delete|post|put")
    private String aclMethod;

    @NotNull(message = "权限类型不能为空")
    @Range(min = 1, max = 3, message = "权限类型1/2/3，菜单/按钮/其它")
    private Integer aclType;

    private String aclIcon;

    @NotNull(message = "权限状态不能为空")
    @Range(min = 0, max = 1, message = "权限状态1/0，正常/冻结")
    private Integer aclStatus;

    @Length(max = 255, message = "权限备注长度不能超过255个字符")
    private String aclRemark;
}
